﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Cabal.Kernel.Cryptilogy
{
    /// <summary>
    /// 无加密类
    /// </summary>
    public class CProviderNoncrypt :ICryptProvider
    {

        #region ICryptProvider 成员

        public string GetName()
        {
            return "noncrypt";
        }

        public byte[] DecryptData(byte[] c)
        {
            return c;
        }

        public byte[] EncryptData(byte[] m)
        {
            return m;
        }

        public string DecryptStringBase64(string c)
        {
            return Encoding.Default.GetString(Convert.FromBase64String(c));
        }

        public string EncryptStringBase64(string m)
        {
            return Convert.ToBase64String(Encoding.Default.GetBytes(m));
        }

        #endregion
    }
}
